<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8"/>
    <title>电影管理系统</title>
    <!--引入Bootstrap 4的css文件-->
    <link href="https://cdn.bootcss.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet"/>
</head>
<body>
<div class="container">
    <p>学号：1604220406 姓名：陈奎志</p>
    <h2>电影详情页</h2>
    <div class="float-right">
        <a class="btn btn-primary" th:href="@{/movie/index}">返回首页</a>
    </div>
    <br/>
    <div class="row">
        <div class="col">
            <label>电影名称：</label>
            <span th:text="${info.name}"></span>
        </div>
        <div class="col">
            <label> 发行日期：</label>
            <span th:text="${info.createDate} ? ${#dates.format(info.createDate,'yyyy-MM-dd')} :''"></span>
        </div>
    </div>
    <a class="btn btn-primary" th:href="@{/role/add/{movieId}(movieId = ${info.id})}">新增</a>
    <h4>演员表</h4>
    <table class="table table-bordered">
        <tr>
            <th>#</th>
            <th>角色</th>
            <th>演员</th>
            <th>操作</th>
        </tr>
        <tr th:each="role, roleStat:${info.roles}">
            <td th:text="${roleStat.index + 1}"></td>
            <td th:text="${role.name}"></td>
            <td th:text="${role.actor.name}"></td>

            <td>
                <a th:href="@{/role/edit/{roleId}(roleId=${role.id})}">编辑</a>
                <a th:href="@{/actor/detail/{actorId}(actorId=${role.actor.id})}">详情</a>
                <a th:href="@{/role/delete/{roleId}(roleId=${role.id})}">删除</a>
            </td>
        </tr>
    </table>
</div>
</body>
</html>